eval(read('/apps/notex.jsx'));
notex.usage('The user administration service',
            {username: 'The "admin/users" service username',
             password: 'The "admin/users" service password',
             action: 'The action to perform',
             user: 'JSON format of a user to update or add'});
notex.service.auth('admin/users');

// Setup database options
var options; eval('options=' + read('../options.jsx'));

// Handle user inserts, updates, deletes and selects
var action = param('action') || 'select';
var user = param('user'); if (user) eval('user=' + user);
var result = notex.service.orm.action(action, 'users', user, options);
write(result.toXMLString());

// END
